package com.hk.PropertyTrain;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

@Configuration
@PropertySource({"classpath:/com/hk/PropertyTrain/mysql.property"})
public class PropertyConfigure {


    @Autowired
    private Environment env;

    @Bean
    public Property getProperty(){

        System.out.println(env);
        return new Property(env.getProperty("user.name"),env.getProperty("user.addr"));
    }


}
